3.905 \(\int \frac{1}{x^2 (a-b+2 a x^2+a x^4)} \, dx\)

Optimal. Leaf size=121 \[ -\frac{1}{x (a-b)}-\frac{\sqrt [4]{a} \tan ^{-1}\left (\frac{\sqrt [4]{a} x}{\sqrt{\sqrt{a}-\sqrt{b}}}\right )}{2 \sqrt{b} \left (\sqrt{a}-\sqrt{b}\right )^{3/2}}+\frac{\sqrt [4]{a} \tan ^{-1}\left (\frac{\sqrt [4]{a} x}{\sqrt{\sqrt{a}+\sqrt{b}}}\right )}{2 \sqrt{b} \left (\sqrt{a}+\sqrt{b}\right )^{3/2}} \]

[Out]

-(1/((a - b)*x)) - (a^(1/4)*ArcTan[(a^(1/4)*x)/Sqrt[Sqrt[a] - Sqrt[b]]])/(2*(Sqrt[a] - Sqrt[b])^(3/2)*Sqrt[b])
 + (a^(1/4)*ArcTan[(a^(1/4)*x)/Sqrt[Sqrt[a] + Sqrt[b]]])/(2*(Sqrt[a] + Sqrt[b])^(3/2)*Sqrt[b])

________________________________________________________________________________________

Rubi [A]  time = 0.112851, antiderivative size = 121, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.136, Rules used = {1123, 1166, 205} \[ -\frac{1}{x (a-b)}-\frac{\sqrt [4]{a} \tan ^{-1}\left (\frac{\sqrt [4]{a} x}{\sqrt{\sqrt{a}-\sqrt{b}}}\right )}{2 \sqrt{b} \left (\sqrt{a}-\sqrt{b}\right )^{3/2}}+\frac{\sqrt [4]{a} \tan ^{-1}\left (\frac{\sqrt [4]{a} x}{\sqrt{\sqrt{a}+\sqrt{b}}}\right )}{2 \sqrt{b} \left (\sqrt{a}+\sqrt{b}\right )^{3/2}} \]

Antiderivative was successfully verified.

[In]

Int[1/(x^2*(a - b + 2*a*x^2 + a*x^4)),x]

[Out]

-(1/((a - b)*x)) - (a^(1/4)*ArcTan[(a^(1/4)*x)/Sqrt[Sqrt[a] - Sqrt[b]]])/(2*(Sqrt[a] - Sqrt[b])^(3/2)*Sqrt[b])
 + (a^(1/4)*ArcTan[(a^(1/4)*x)/Sqrt[Sqrt[a] + Sqrt[b]]])/(2*(Sqrt[a] + Sqrt[b])^(3/2)*Sqrt[b])

Rule 1123

Int[((d_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*x^2 +
 c*x^4)^(p + 1))/(a*d*(m + 1)), x] - Dist[1/(a*d^2*(m + 1)), Int[(d*x)^(m + 2)*(b*(m + 2*p + 3) + c*(m + 4*p +
 5)*x^2)*(a + b*x^2 + c*x^4)^p, x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[m, -1] && In
tegerQ[2*p] && (IntegerQ[p] || IntegerQ[m])

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{1}{x^2 \left (a-b+2 a x^2+a x^4\right )} \, dx &=-\frac{1}{(a-b) x}-\frac{\int \frac{-2 a-a x^2}{a-b+2 a x^2+a x^4} \, dx}{-a+b}\\ &=-\frac{1}{(a-b) x}-\frac{a \int \frac{1}{a-\sqrt{a} \sqrt{b}+a x^2} \, dx}{2 \left (\sqrt{a}-\sqrt{b}\right ) \sqrt{b}}+\frac{a \int \frac{1}{a+\sqrt{a} \sqrt{b}+a x^2} \, dx}{2 \left (\sqrt{a}+\sqrt{b}\right ) \sqrt{b}}\\ &=-\frac{1}{(a-b) x}-\frac{\sqrt [4]{a} \tan ^{-1}\left (\frac{\sqrt [4]{a} x}{\sqrt{\sqrt{a}-\sqrt{b}}}\right )}{2 \left (\sqrt{a}-\sqrt{b}\right )^{3/2} \sqrt{b}}+\frac{\sqrt [4]{a} \tan ^{-1}\left (\frac{\sqrt [4]{a} x}{\sqrt{\sqrt{a}+\sqrt{b}}}\right )}{2 \left (\sqrt{a}+\sqrt{b}\right )^{3/2} \sqrt{b}}\\ \end{align*}

Mathematica [A]  time = 0.15068, size = 143, normalized size = 1.18 \[ \frac{\frac{\left (\sqrt{a} \sqrt{b}+a\right ) \tan ^{-1}\left (\frac{\sqrt{a} x}{\sqrt{a-\sqrt{a} \sqrt{b}}}\right )}{\sqrt{b} \sqrt{a-\sqrt{a} \sqrt{b}}}-\frac{\left (a-\sqrt{a} \sqrt{b}\right ) \tan ^{-1}\left (\frac{\sqrt{a} x}{\sqrt{\sqrt{a} \sqrt{b}+a}}\right )}{\sqrt{b} \sqrt{\sqrt{a} \sqrt{b}+a}}+\frac{2}{x}}{2 (b-a)} \]

Antiderivative was successfully verified.

[In]

Integrate[1/(x^2*(a - b + 2*a*x^2 + a*x^4)),x]

[Out]

(2/x + ((a + Sqrt[a]*Sqrt[b])*ArcTan[(Sqrt[a]*x)/Sqrt[a - Sqrt[a]*Sqrt[b]]])/(Sqrt[a - Sqrt[a]*Sqrt[b]]*Sqrt[b
]) - ((a - Sqrt[a]*Sqrt[b])*ArcTan[(Sqrt[a]*x)/Sqrt[a + Sqrt[a]*Sqrt[b]]])/(Sqrt[a + Sqrt[a]*Sqrt[b]]*Sqrt[b])
)/(2*(-a + b))

________________________________________________________________________________________

Maple [B]  time = 0.144, size = 180, normalized size = 1.5 \begin{align*}{\frac{a}{2\,a-2\,b}{\it Artanh} \left ({ax{\frac{1}{\sqrt{ \left ( \sqrt{ab}-a \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( \sqrt{ab}-a \right ) a}}}}+{\frac{{a}^{2}}{2\,a-2\,b}{\it Artanh} \left ({ax{\frac{1}{\sqrt{ \left ( \sqrt{ab}-a \right ) a}}}} \right ){\frac{1}{\sqrt{ab}}}{\frac{1}{\sqrt{ \left ( \sqrt{ab}-a \right ) a}}}}-{\frac{a}{2\,a-2\,b}\arctan \left ({ax{\frac{1}{\sqrt{ \left ( \sqrt{ab}+a \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( \sqrt{ab}+a \right ) a}}}}+{\frac{{a}^{2}}{2\,a-2\,b}\arctan \left ({ax{\frac{1}{\sqrt{ \left ( \sqrt{ab}+a \right ) a}}}} \right ){\frac{1}{\sqrt{ab}}}{\frac{1}{\sqrt{ \left ( \sqrt{ab}+a \right ) a}}}}-{\frac{1}{ \left ( a-b \right ) x}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/x^2/(a*x^4+2*a*x^2+a-b),x)

[Out]

1/2*a/(a-b)/(((a*b)^(1/2)-a)*a)^(1/2)*arctanh(a*x/(((a*b)^(1/2)-a)*a)^(1/2))+1/2*a^2/(a-b)/(a*b)^(1/2)/(((a*b)
^(1/2)-a)*a)^(1/2)*arctanh(a*x/(((a*b)^(1/2)-a)*a)^(1/2))-1/2*a/(a-b)/(((a*b)^(1/2)+a)*a)^(1/2)*arctan(a*x/(((
a*b)^(1/2)+a)*a)^(1/2))+1/2*a^2/(a-b)/(a*b)^(1/2)/(((a*b)^(1/2)+a)*a)^(1/2)*arctan(a*x/(((a*b)^(1/2)+a)*a)^(1/
2))-1/(a-b)/x

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/x^2/(a*x^4+2*a*x^2+a-b),x, algorithm="maxima")

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Fricas [B]  time = 1.67398, size = 3290, normalized size = 27.19 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/x^2/(a*x^4+2*a*x^2+a-b),x, algorithm="fricas")

[Out]

1/4*((a - b)*x*sqrt(-(a^2 + 3*a*b + (a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b
- 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4))*log
((3*a^2 + a*b)*x + (6*a^2*b + 2*a*b^2 - (a^4*b - 2*a^3*b^2 + 2*a*b^4 - b^5)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^
6*b - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))*sqrt(-(a^2 + 3*a*b + (a^3*b - 3*a^2*
b^2 + 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5
- 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4))) - (a - b)*x*sqrt(-(a^2 + 3*a*b + (a^3*b - 3*a^2*b^2 +
 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a
*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4))*log((3*a^2 + a*b)*x - (6*a^2*b + 2*a*b^2 - (a^4*b - 2*a^3*b
^2 + 2*a*b^4 - b^5)*sqrt((9*a^3 + 6*a^2*b + a*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a*b)*x - (6*a^2*b + 2*a*b^2 + (a^4*b - 2*a^3*b^2
 + 2*a*b^4 - b^5)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6
*a*b^6 + b^7)))*sqrt(-(a^2 + 3*a*b - (a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4)*sqrt((9*a^3 + 6*a^2*b + a*b^2)/(a^6*b
 - 6*a^5*b^2 + 15*a^4*b^3 - 20*a^3*b^4 + 15*a^2*b^5 - 6*a*b^6 + b^7)))/(a^3*b - 3*a^2*b^2 + 3*a*b^3 - b^4))) -
 4)/((a - b)*x)

________________________________________________________________________________________

Sympy [A]  time = 2.26557, size = 134, normalized size = 1.11 \begin{align*} \operatorname{RootSum}{\left (t^{4} \left (256 a^{3} b^{2} - 768 a^{2} b^{3} + 768 a b^{4} - 256 b^{5}\right ) + t^{2} \left (32 a^{2} b + 96 a b^{2}\right ) + a, \left ( t \mapsto t \log{\left (x + \frac{64 t^{3} a^{4} b - 128 t^{3} a^{3} b^{2} + 128 t^{3} a b^{4} - 64 t^{3} b^{5} + 4 t a^{3} + 40 t a^{2} b + 20 t a b^{2}}{3 a^{2} + a b} \right )} \right )\right )} - \frac{1}{x \left (a - b\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/x**2/(a*x**4+2*a*x**2+a-b),x)

[Out]

RootSum(_t**4*(256*a**3*b**2 - 768*a**2*b**3 + 768*a*b**4 - 256*b**5) + _t**2*(32*a**2*b + 96*a*b**2) + a, Lam
bda(_t, _t*log(x + (64*_t**3*a**4*b - 128*_t**3*a**3*b**2 + 128*_t**3*a*b**4 - 64*_t**3*b**5 + 4*_t*a**3 + 40*
_t*a**2*b + 20*_t*a*b**2)/(3*a**2 + a*b)))) - 1/(x*(a - b))

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/x^2/(a*x^4+2*a*x^2+a-b),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError